package com.mushiengine.core {
import com.mushiengine.core.error.DiggbeError;

public class Diggbe {

    private static var _beanLoader:IBeanLoader;


    public function Diggbe() {
        throw new DiggbeError("This class is desgin to only have static members");
    }

    public static function loadBeanDefinition(beanDef:IBeanDefinitionLoader):void {
        if (_beanLoader == null) _beanLoader = new BeanLoader();
        _beanLoader.loadBeanDefinition(beanDef);
    }

    public static function addbean(key:String, objectInst:*):void {
        if (_beanLoader == null) _beanLoader = new BeanLoader();
        _beanLoader.addbean(key, objectInst);
    }

    public static function getBean(beanId:String):* {
        if (_beanLoader == null) _beanLoader = new BeanLoader();
        return _beanLoader.getBean(beanId);
    }


    public static function removeBean(beanId:String):void {
        _beanLoader.removeBean(beanId);
    }

    internal static function setBeanLoaderForTest(value:IBeanLoader):void {
        _beanLoader = value;
    }


}
}